/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-11-08
 * Time: 19:04
 */
public class Main1 {
    public static void main(String[] args) {
        SharedStack sharedStack = new SharedStack(10);

        sharedStack.push1(1);
        sharedStack.push1(2);
        sharedStack.push1(3);
        System.out.println("S1栈顶元素（预期为3）: " + sharedStack.peek1());

        System.out.println("从S1弹出的元素: " + sharedStack.pop1());
        System.out.println("S1栈顶元素（预期为2）: " + sharedStack.peek1());

        sharedStack.push2(4);
        sharedStack.push2(5);
        sharedStack.push2(6);
        System.out.println("S2栈顶元素（预期为6）: " + sharedStack.peek2());

        System.out.println("从S2弹出的元素: " + sharedStack.pop2());
        System.out.println("S2栈顶元素（预期为5）: " + sharedStack.peek2());

        System.out.println("S1是否为空: " + sharedStack.isEmpty1());
        System.out.println("S2是否为空: " + sharedStack.isEmpty2());

        sharedStack.push1(7);
        sharedStack.push2(8);

        System.out.println("S1栈顶元素（预期为7）: " + sharedStack.peek1());
        System.out.println("S2栈顶元素（预期为8）: " + sharedStack.peek2());
    }
}